import request from '@/utils/request'

//  分页查询未分配代理人的任务信息
export function handleGetUnassignedTaskPageList(query) {
  return request({
    url: '/api/flow/instance/task/unassigned',
    method: 'post',
    data: query
  })
}

//  分页查询待办任务信息
export function handleGetIncompleteTaskPageList(query) {
  return request({
    url: '/api/flow/instance/task/incomplete',
    method: 'post',
    data: query
  })
}

//  分页查询已办任务信息
export function handleGetCompleteTaskPageList(query) {
  return request({
    url: '/api/flow/instance/task/completed/his',
    method: 'post',
    data: query
  })
}

//  分页查询实例任务信息
export function handleGetTask(query) {
  return request({
    url: '/api/flow/instance/task/list',
    method: 'post',
    data: query
  })
}

//  执行完成任务
export function handleComplete(data) {
  return request({
    url: '/api/flow/instance/task/complete',
    method: 'post',
    data: data
  })
}

// 领取任务
export function handleClaim(data) {
  return request({
    url: '/api/flow/instance/task/claim',
    method: 'post',
    params: data
  })
}

// 委派任务
export function handleDelegate(data) {
  return request({
    url: '/api/flow/instance/task/delegate',
    method: 'post',
    params: data
  })
}

// 指派任务
export function handleAssign(data) {
  return request({
    url: '/api/flow/instance/task/assign',
    method: 'post',
    params: data
  })
}

// 任务详情
export function handleDetail(data) {
  return request({
    url: '/api/flow/instance/task/detail',
    method: 'post',
    params: data
  })
}

// 审核提交任务
export function handleAudit(data) {
  return request({
    url: '/api/flow/workbench/audit',
    method: 'post',
    params: data
  })
}
